import { createRouter,createMemoryHistory, createWebHistory } from "vue-router";
const Login=()=>import("@/views/login/index.vue")
const Layout=()=>import("@/views/layout/index.vue")
const Home=()=>import("@/views/home/index.vue")

const constRoutes=[
  {
    path:'/login',
    name:'login',
    component:Login,
    meta:{title:"登录页"}

  },
  {
    path:"/",
    component:Layout,
    children:[
      {
        path:"./home",
        component:Home
      }
    ]
  },{
    path:"/404",
    component:()=>import("@/views/common/error/404.vue")
  },
  {
    path:"/:pathMatch(.*)",
    redirect:"/404"
  }

]
const router=createRouter({
  history:createWebHistory(),
  routes:constRoutes
})

export default router